import os

with open('my.txt', 'ab+') as f:
	while True:
		s = input('请输入值:')
		if s == 'exit':
			break
		f.write((s + os.linesep).encode('utf'))
